<%@ include file="/taglibs.jsp"%>
<%@ page pageEncoding="UTF-8"%>

<%@ page import="org.springframework.context.ApplicationContext,
	org.springframework.web.context.support.WebApplicationContextUtils,
	org.jawa.model.*,
	org.jawa.service.*,
	java.util.*"
%>

<%
	ApplicationContext ctx=WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()); 
	CategoryManager categoryManager=(CategoryManager)ctx.getBean("categoryManager");
	ProductManager productManager=(ProductManager)ctx.getBean("productManager");
	List<Category> list=categoryManager.getAll();
	List<Product> productHot=productManager.getHot();
	List<Product> productNews=productManager.getNew();
%>
<img alt="" style="display: none;" src="/images/b.jpg" height="1" width="1">
<noscript>
	<img alt="" src="" width="1" height="1" style="display: none">
</noscript>
<!-- 左边开始 -->
<div class="colL" style="filter: none; z-index: 2;">
	<div class="openCategory" id="openCategory" style="display: none; z-index: 99999; position: absolute;">
		<div class="win winHomeA">
			<a class="closeCategoryIcon" id="closeCategoryIcon" href="javascript:void(0);"></a>
			<h3>Browse by Category</h3>
		</div>
	</div>
	<!-- 左边上标题开始 -->
	<div class="win winHomeA">
		<a class="openCategoryIcon" id="openCategoryIcon" href="javascript:void(0);"></a>
		<h3>Browse by Category</h3>
		<div class="box mainCategory" id="divExchangeContianer">
			<ul>
				<li class="" id="level_1">
					<a	href=""><strong>A</strong>griculture</a>
				</li>
				<li id="level_2">
					<a href=""><strong>A</strong>pparel</a>
				</li>
				<li id="level_3">
					<a href=""><strong>A</strong>utomobiles&amp; Motorcycles</a>
				</li>
				<li id="level_4">
					<a href=""><strong>B</strong>usiness Services</a>
				</li>
			</ul>
			<div class="displayProductNav">
				<strong>Want more inquiries?</strong> 
				<a href="" class="btnDisplayProducts">Display Your Products</a>
			</div>
			<!-- Trade Trends begin -->
			<div class="displayProductNav">
				<span>Trade Trends</span>
			</div>
			<div style="text-align: right; padding-right: 5px;">
				<a class="more" style="font-size: 0.9em; font-family: Verdana;"
					href="http://www.alibaba.com/trade-trends.html">View all</a>
			</div>
		</div>
	</div>
	<!-- 左边上标题结束 -->
	<iframe style="display: none; z-index: 99998; top: 0px; left: 0px;" class="maskIframe" frameborder="0"></iframe>

	<div style="clear: both;"></div>
	<!-- 左边下标题开始 -->
	<div class="win winHomeB">
		<h3>
			<a href="" title="Featured Partner" class="titleLinkB">Featured Partner</a>
		</h3>
		<div class="box"
			style="background: rgb(255, 255, 255) none repeat scroll 0% 0%; font-size: 12px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-bottom: 12px; line-height: 12px; padding-top: 10px; font-family: verdana; text-align: center;">
			<div style="border-bottom: 1px dotted rgb(221, 221, 221); padding: 5px 0px; margin-bottom: 5px;">
				<a	href="">
					<strong>Partner with Us</strong>
				</a>
			</div>
			<a href="">
				<img src="/images/home_partners_080311.gif" border="0"><br>
					FirmaFrance 
			</a><br>
			<br>
			<a	href="">
				<img src="/images/cietac.gif" border="0"><br>
					Dispute Resolution 
			</a>
			<br>
		</div>
	</div>
	<!-- 左边下标题结束 -->
</div>
<!-- 左边结束 -->

<!-- colL -->
<div class="colR"><!-- 中间部分开始 -->
	<div class="colRmargin"><!-- 滚动新闻开始 -->
		<div class="homeAd" style="">
			<div class="column" style="width: 60px;">
				<strong> 
					<span style="color: rgb(255, 115, 0);">Hot News</span>
				</strong>
			</div>		
			<div class="column" style="width: 550px;">
				<style>
					ul.hotNews {
						overflow: hidden;
						height: 12px;
						width: 100%;
						padding: 0px;
						margin: 0px;
					}
					
					ul.hotNews li {
						padding: 0px;
						margin: 0px;
					}
				</style>
				<div style="margin: 3px 0pt; height: 12px; font-family: verdana; font-style: normal; font-variant: normal; 
					font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; 
					-x-system-font: none; float: left;">
					<ul class="hotNews" id="hotNews" style="list-style-image: none;">
						<li>
							<strong>
								<a class="more" href="">	Alibaba.com Ranks No. 3 On The Asia BW 50 </a>
							</strong>
						</li>
						<li>
							<strong> 
								<a class="more" href="">	Alibaba.com Open Sesame India Opens to a Full House </a> 
							</strong>
						</li>
						<li>
							<strong>
								<a class="more" href="">Jack Ma named one of The 25 Most Influential People on the Web </a> 
							</strong>
						</li>
						<li>
							<strong> 
								<a class="more" href="">	Alibaba.com launched a global advertising campaign on CNBC on August 4</a> 
							</strong>
						</li>
						<li>
							<strong> 
								<a class="more" href="">	China's Alibaba Expands to India, Japan </a> 
							</strong>
						</li>
					</ul>
				</div>
			</div>
			<div style="clear: both;"></div>
			<div>
				<a href="" target="_blank">
					<img src="${ctx}/images/jawashop/supplier_767x50_20081006.gif"	alt="Be a Super Supplier!" border="0">
				</a>
			</div>
		</div>
		<!-- 滚动新闻结束 --> 
		<script type="text/javascript">
			var hotnewsAE = AE.widget.SimpleScroll.decorate('hotNews', {lineHeight: 12, startDelay: 1});
		</script>
	
		<div class="colRL">
			<div class="colRLmargin">
				<%
					if(null!=list){						
						for(Iterator<Category> it=list.iterator();it.hasNext();){
							Category category=it.next();						
				%>
				<!-- 中间部分上面第一个框开始 --> 
				<div class="tabsH format3" id="productCycle">
					<div class="tabsRight">
						<div class="titleLink"><a
							href="${ctx}/pages/category.html?id=<%=category.getId()%>" class="titleLinkText">more</a>
						</div>
					</div>
					<h3><a href=""
						class="titleLinkB" title=""><%=category.getCatename() %></a>
					</h3>
				
					<div style="clear: both;"></div>
					<div class="box s"
						style="background: rgb(255, 255, 255) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
						<style>
							.pAgent {
								color: #003399;
								font-size: 12px;
								height: 28px;
								line-height: 12px;
								overflow: hidden;
							}
							
							.pAgency {
								color: #666;
								font-size: 11px;
								padding: 4px 0px 2px;
							}
							
							.pFree {
								font-size: 15px;
								color: #cc0000;
								padding: 4px 0px 2px;
								font-weight: bold;
							}
							
							.pFree a {
								font-size: 15px;
								color: #cc0000;
								padding: 4px 0px 2px;
								font-weight: bold;
							}
							
							.pFree span {
								font-size: 11px;
								font-weight: normal;
							}
							
							.pHot {
								padding-top: 10px;
							}
						</style>
						<div id="superDeals" class="superDeals">
							<div class="productList" style="">
								
								<%
									for(Iterator<Product> pit= category.getProducts().iterator();pit.hasNext();){
										Product product=pit.next();
								%>
								<div class="productItem">
									<ul>
										<li class="productImg">
											<a href="${ctx}/pages/product.html?id=<%=product.getId()%>" target="_blank">
												<img src="<%=product.getProductphoto() %>" alt="<%=product.getProductname() %>" title="<%=product.getProductdesc() %>" border="0" height="58" width="58">
											</a>
										</li>
									</ul>
									<p class="pName"><%=product.getProductname() %></p>
									<p class="pFree"><span>￥</span><%=product.getPrice() %></p>
									<p class="pOrder"><fmt:message key="product.view" /><%=product.getHit() %></p>
								</div>
								<%} %>
								<div style="clear: both;"></div>
							</div>
						</div>
					</div>
				</div>
				<%
					}
					}
				%>
				<!-- 中间部分上面第一个框结束 -->				
			</div>
		</div>
	<!-- 中间部分结束 --> <!-- colRL -->	
		<div class="colRR">
			<div id="userGuide" class="userGuide">
				<div class="join">
					<a href="http://us.my.alibaba.com/user/join/join_step1.htm">
						<img src="${ctx}/images/jawashop/join.gif">
					</a>
					<strong>
						<a	href="" style="color: rgb(165, 63, 20);"	onclick="try {clk('homepage_join_website');}catch(e){}">
							Get a FREE	<br>Company Website! 
						</a>
					</strong>
				</div>
				<div id="userRecommend" class="userRecommend">
					<a href="http://sh.vip.alibaba.com/product/post_product.htm" rel="panel_1" class="userRecommendTab smallTab">
						<strong class="freeIcon">Display Your Products</strong>
					</a> 
					<a	href="" rel="panel_2" class="userRecommendTab smallTab mouseHover">
						<strong class="freeIcon">Post Your <br>Purchase Requests </strong>
					</a>
					<div class="userRecommendContent" id="panel_1" style="display: none;">
						<div class="contentGroup">
							<strong>Still waiting for inquiries?<br>Reach buyers fast! </strong><br><br>
							<a href="http://sh.vip.alibaba.com/product/post_product.htm">Display	Your Products Free!</a>
						</div>
					</div>
			
					<div style="" class="userRecommendContent rightborder" id="panel_2">
						<div class="contentGroup">
							<strong>Take the effort out of sourcing!<br>Tell suppliers exactly what you need </strong><br>
							<br>
							<a	href="http://us.my.alibaba.com/product/buyoffer/myalibaba/post_buying_lead_no_member.htm">Absolutely	Free! No Sign in Required</a>
						</div>
					</div>
					<div class="recommendBoard">
						<a href="javascript:void(0)" rel="panel_3" class="userRecommendTab bigTab" style="cursor: default;">
							<div id="chinese1" style="">
								<img	src="/images/jawashop/cnTextGsTab.gif">
							</div>
							<div id="chineseT1" style="display: none;">
								<img	src="/images/jawashop/zhTextGsTab.gif">
							</div>
							<div id="english1" style="display: none;">
								<img	src="/images/jawashop/enTextTpTab.gif">
							</div>
						</a>
						<div class="userRecommendContent" id="panel_3" style="display: none;">
							<div id="chinese2" style="">
								<img src="/images/jawashop/cnTextGsContentNew.gif"	usemap="#mapCnGs" border="0">
								<map name="mapCnGs" id="mapCnGs">
									<area shape="rect" coords="56,57,120,75"	href="">
									<area shape="rect" coords="165,57,215,75"	href="">
									<area shape="rect" coords="180,84,255,102" href=""	target="_blank">
								</map>
							</div>
					
							<div id="chineseT2" style="display: none;">
								<img	src="/images/jawashop/zhTextGsContent.gif" usemap="#mapZhGs" border="0">
								<map name="mapZhGs" id="mapZhGs">
									<area shape="rect" coords="25,76,150,94"	href="">
									<area shape="rect" coords="178,76,255,94"	href="">
								</map>
							</div>
					
							<div id="english2" style="display: none;">
								<img src="/images/jawashop/enTextTpContent.gif"	usemap="#mapEnTp" border="0">
								<map name="mapEnTp" id="mapEnTp">
									<area shape="rect" coords="26,71,93,89"	href="">
									<area shape="rect" coords="100,71,188,89"	href="">
								</map>
							</div>
						</div>
					</div>
					<!-- end of recommendBoard -->
				</div>
				<!-- end of userRecommend -->
			
				<div class="bottomInfo">
					<span id="inChinaButton" style="" class="s"> 
						<a href="javascript:show_it(2)">Not from China?Click here.</a> &nbsp; 
						<a href="javascript:show_it(1)">
							<img src="/images/jawashop/seeTraditionalChinese.gif" align="absbottom">
						</a>
					</span>
					<span id="inHongkongButton"	style="display: none;" class="s"> 
						<a	href="javascript:show_it(2)">Not from China? Click here.</a> &nbsp; 
						<a	href="javascript:show_it(0)">
							<img src="/images/jawashop/seeSimpleChinese.gif" align="absbottom">
						</a>
					</span>
					<span id="outsideChinaButton" style="display: none;" class="s"> 
						<a	href="javascript:show_it(0)">
							<img src="/images/jawashop/seeSimpleChinese01.gif" align="absbottom">
						</a> &nbsp;
						<a href="javascript:show_it(1)">
							<img src="/images/jawashop/seeTraditionalChinese.gif" align="absbottom">
						</a>
					</span>
				</div>
			</div>
			
			<script type="text/javascript">
			var userIsLogin = false;
			var userIpCountry = 0;
			var userType = -1;
			var userShowLanguage = 0;
			var userCurrentTab = 0;
			
			if (userIsLogin) {
			  if (userType == 1 || userType == 2) {
			    userShowLanguage = 0;
			  } else if (userType == 3 || userType == 4) {
			    userShowLanguage = 1;
			  } else if (userType == 5 || userType == 6) {
			    userShowLanguage = 2;
			  }
			  show_it(userShowLanguage);
			  
			  if (userType == 1 || userType == 3 || userType == 5) {
			    userCurrentTab = 0;
			  } else if (userType == 2 || userType == 4 || userType == 6) {
			    userCurrentTab = 2;
			  }
			} else {
			  show_it(userIpCountry);
			  userCurrentTab = 1;
			}
			
			(function(){var yConfig = {
			sTabClass:"userRecommendTab",
			sItemClass:"userRecommendContent",
			oParentNode:get('userRecommend'),
			iCycleTimes:0,
			currentIndex:userCurrentTab,
			sSwitchEvent:"mouseover",
			sCurrentClass:"mouseHover",
			sOrder:"asc"
			}
			var myDiv = new divCycle();
			myDiv.init(yConfig);
			})();
			
			function show_it(n){
			  var n;
			  if(n == 0){    //Simple Chinese
			    get('inChinaButton').style.display = "";
			    get('inHongkongButton').style.display = "none";
			    get('outsideChinaButton').style.display = "none";
			    
			    document.getElementById("chinese1").style.display = "";
			    document.getElementById("chineseT1").style.display = "none";
			    document.getElementById("english1").style.display = "none";
			    
			    document.getElementById("chinese2").style.display = "";
			    document.getElementById("chineseT2").style.display = "none";
			    document.getElementById("english2").style.display = "none";
			  }else if (n==1){    //Traditinal Chinese
			    get('inChinaButton').style.display = "none";
			    get('inHongkongButton').style.display = "";
			    get('outsideChinaButton').style.display = "none";
			
			    document.getElementById("chinese1").style.display = "none";
			    document.getElementById("chineseT1").style.display = "";
			    document.getElementById("english1").style.display = "none";
			    
			    document.getElementById("chinese2").style.display = "none";
			    document.getElementById("chineseT2").style.display = "";
			    document.getElementById("english2").style.display = "none";
			  }else{    //English
			    get('inChinaButton').style.display = "none";
			    get('inHongkongButton').style.display = "none";
			    get('outsideChinaButton').style.display = "";
			
			    document.getElementById("chinese1").style.display = "none";
			    document.getElementById("chineseT1").style.display = "none";
			    document.getElementById("english1").style.display = "";
			    
			    document.getElementById("chinese2").style.display = "none";
			    document.getElementById("chineseT2").style.display = "none";
			    document.getElementById("english2").style.display = "";
			  }
			  if (n==0 || n==1) document.getElementById("chinese7").style.display = "";
			  
			  //India
			  if (n==3) {
			  	if(get("india3")){
			  		document.getElementById("india3").style.display = "";
			  	}
			  };
			}
			</script>

			<div class="bigBuyer">
				
				<h3><fmt:message key="products.hot"/></h3>
				<div class="box photoGallery">
					<ul style="padding-top: 10px;">
						<%
							if(null!=productHot){
								for(Iterator<Product> it= productHot.iterator();it.hasNext();){
									Product product=it.next();
						%>
						<li onmouseover="this.className='photo_over';" onmouseout="this.className='photo_out';" style="margin: 0px 10px 5px 5px;">
							<a rel="nofollow" href="${ctx}/pages/product.html?id=<%=product.getId() %>" class="imgBorder" target="_blank">
								<div class="photoFrame">
									<img src="<%=product.getProductphoto() %>" alt="<%=product.getProductname() %>" title="<%=product.getProductdesc() %>">
								</div>
							</a>
							<p>
								<fmt:message key="product.price"/><%=product.getPrice() %>
							</p>
						</li>
						<%
								}
							}
						%>
					</ul>
					<div style="clear: both;"></div>
					<div style="padding-bottom: 5px;" align="right">
						<a class="more"	href="${ctx}/pages/product.html" target="_blank"	style="font-size: 0.85em;">More</a>
					</div>
				</div>
			</div>
			<div class="win winHomeB" style="margin: 10px 0pt 0pt;">
				<style type="text/css" media="all">
					@import url("../styles/news.css");
					.photoGallery ul {
						list-style: none;
						padding: 0;
						margin: 0 0 10px 4px;
						clear: both !important;
					}
				</style>
				<h3>
					<fmt:message key="product.news"/>
				</h3>
				<div class="box photoGallery">
					<ul style="padding-top: 10px;">
						<%
							if(null!=productNews){
								for(Iterator<Product> it= productNews.iterator();it.hasNext();){
									Product product=it.next();
						%>
						<li onmouseover="this.className='photo_over';" onmouseout="this.className='photo_out';" style="margin: 0px 5px 5px 0px;">
							<a rel="nofollow" href="${ctx}/pages/product.html?id=<%=product.getId() %>" class="imgBorder" target="_blank">
								<div class="photoFrame">
									<img src="<%=product.getProductphoto() %>" alt="<%=product.getProductname() %>" title="<%=product.getProductdesc() %>">
								</div>
							</a>
							<p>
								<fmt:message key="product.price"/><%=product.getPrice() %>
							</p>
						</li>
						<%
								}
							}
						%>
					</ul>
					<div style="clear: both;"></div>
					<div style="padding-bottom: 5px;" align="right">
						<a class="more"	href="${ctx}/pages/product.html" target="_blank"	style="font-size: 0.85em;">More</a>
					</div>
				</div>
			</div>
		</div>
	<!-- colRR -->
		<div style="clear: both;"></div>
	</div>
</div>	
<script type="text/javascript">
	YUE.on(window, 'load', function() {
		AE.webUser.writeWelcomeInfo('welcome_info');
		var headerUnread = new getMessageStatus();
		headerUnread.init();
	})
</script>